Recordid with a field containing comma how to?

arcullarcull Member Posts: 191
Hi there. Anyone knows if it is possible to create and use recordid variable, if one or more fields that make up the primary key contain a comma inside. I mean like this "GUILDFORD, 10 CR", which is job no. in cronus company. When trying to create recordid I get the error "You cannot enter 'Job: GUILDFORD, 10 CR' in RecordID". Any advice much appreciated, thanks.

Answers

  • kapamaroukapamarou Member Posts: 1,152
    Tried using quotes?


    EVALUATE(RecordIDVar,'Job: "GUILDFORD, 10 CR"');
  • matteo_montanarimatteo_montanari Member Posts: 189
    arcull wrote:
    Hi there. Anyone knows if it is possible to create and use recordid variable, if one or more fields that make up the primary key contain a comma inside. I mean like this "GUILDFORD, 10 CR", which is job no. in cronus company. When trying to create recordid I get the error "You cannot enter 'Job: GUILDFORD, 10 CR' in RecordID". Any advice much appreciated, thanks.

    Hi

    this code:
    job	Record	Job	
    RecRef	RecordRef		
    RecID	RecordID
    
    job.GET('DEERFIELD, 8 PL');
    RecRef.GETTABLE(job);
    RecID := RecRef.RECORDID;
    MESSAGE('%1',RecID);
    

    Works.

    Can we see your code?

    Bye

    Matteo
    Reno Sistemi Navision Developer
  • arcullarcull Member Posts: 191
    Thanks mates, you gave me a few ideas. The last attempt with double quotes works. Thanks again
    q := 39;  // single quote
    q := 34;  // double quote
    
    //Str := 'Job: GUILDFORD, 10 CR';
    //Str := format(q) + 'Job: GUILDFORD, 10 CR' + format(q);
    Str := 'Job: ' + format(q) + 'GUILDFORD, 10 CR' + format(q);
    
    EVALUATE(RecId,Str);
    IF RecR.GET(RecId) THEN
      MESSAGE('Found');
    
  • kapamaroukapamarou Member Posts: 1,152
    You're welcome.
Sign In or Register to comment.