× Discuss on T24 Installation, Setting up the environment, TC Server, jBOSS, Package & Deployment, etc…

Build Routine-Account releted to inputted Customer

  • vijaygubbi
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 years 2 months ago #13864 by vijaygubbi
Hi all,
I need to write build routine regard to the account, from account application i need to get the inputted customer id from that customer i need to select the primary account related to that customer.
for this may i use the customer.account...
please any one may reply for this quiry.
My prog:
INIT:
DEBUG
FN.ACC='F.ACCOUNT' ; F.ACC=''
Y.APP='ACCOUNT'
Y.APP.FLD='LR.PRIM.ACC'
Y.APP.POS=''
Y.ACC.ID=ID.OLD
RETURN
OPENFILE:
CALL OPF(FN.ACC,F.ACC)
CALL GET.LOC.REF(Y.APP,Y.APP.FLD,Y.APP.POS)
Y.PRM.ACC=Y.APP.POS
RETURN
PROCESS:
LOCATE 'CUSTOMER' IN ENQ.DATA<2,1> SETTING Y.CUS.POS ELSE NULL
Y.CUS.ID=ENQ.DATA<4,Y.CUS.POS>
CALL F.READ(FN.ACC,Y.ACC.ID,R.ACC,F.ACC,ACC.ERR)
Y.CUS=R.ACC<AC.CUSTOMER>
Y.PR.STATUS=R.ACC<AC.LOCAL.REF,Y.PRM.ACC>
Y.FIELDS.COUNT=DCOUNT(ENQ.DATA<2>,VM)+1
ENQ.DATA<2,Y.FIELDS.COUNT>='CUSTOMER'
ENQ.DATA<3,Y.FIELDS.COUNT>='EQ'
IF Y.PR.STATUS EQ "YES" THEN
ENQ.DATA<4,Y.FIELDS.COUNT>=Y.CUS
END
RETURN
END

its not working properly,if anything make changes in this..

Please Log in or Create an account to join the conversation.

  • jpb
  • jpb's Avatar
  • Offline
  • Moderator
  • Moderator
  • retired . . . ¯\_(ツ)_/¯
More
12 years 2 months ago #13873 by jpb
- to get the CUSTOMER just use R.NEW(AC.CUSTOMER)

I don't understand what you want to do with the ENQ.DATA:

If CUSTOMER is already there you set Y.CUS.ID, and then ? What for??
If you have to use the AC.CUSTOMER just overwrite ENQ.DATA<4,Y.CUS.POS>, else append the selection at the end with
ENQ.DATA<2,-1>='CUSTOMER'
ENQ.DATA<3,-1>='EQ'
ENQ.DATA<4,-1>= R.NEW(AC.CUSOMER)

Please Log in or Create an account to join the conversation.

Time to create page: 0.038 seconds