copy dimension value from a company to another company

gazpachogazpacho Member Posts: 48
Hello,

I want to copy the value of Global Dimension 1 of a contact in company A to a contact in company B. When I assign them with

RecContactCompanyB."Global Dimension 1 Code" := RecContactCompanyA."Global Dimension 1 Code"

it does not work. The field in RecContactCompanyB remains empty. What am I doing wrong ?

Best regards

Josh R.

Comments

  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Call MODIFY.
  • gazpachogazpacho Member Posts: 48
    Ok, sorry if I was not clear. Of course I call MODIFY after this. But it still remains empty.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Please post more code, looking at what you have provided we cannot help you.
  • gazpachogazpacho Member Posts: 48
    RecContactCompanyB.CHANGECOMPANY(‘Company B’);
    IF NOT(RecContactCompanyB.GET(RecContactCompanyA." No.")) THEN
    EXIT
    ELSE BEGIN
    RecContactCompanyB."Global Dimension 1 Code" := RecContactCompanyA."Global Dimension 1 Code";
    RecContactcompanyB.MODIFY;
    END;
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Maybe RecContactCompanyA.GET is missing.
  • gazpachogazpacho Member Posts: 48
    I checked it; RecContactCompanyA is not empty.
  • krikikriki Member, Moderator Posts: 9,118
    gazpacho wrote:
    RecContactCompanyB.CHANGECOMPANY(‘Company B’);
    IF NOT(RecContactCompanyB.GET(RecContactCompanyA." No.")) THEN
    EXIT
    ELSE BEGIN
    RecContactCompanyB."Global Dimension 1 Code" := RecContactCompanyA."Global Dimension 1 Code";
    RecContactcompanyB.MODIFY;
    END;
    Are you sure that "RecContactCompanyB.GET" gets you a record?
    If you change the "EXIT" with an "ERROR('No record found');", and you get the error, it means you didn't find a record.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Or remove the IF condition and receive a runtime error
Sign In or Register to comment.