web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Can eConnect create the PACustomerProjectMaster record?

(0) ShareShare
ReportReport
Posted on by 75,852 Moderator

I have routines that import project accounting projects. We recently had a situation where the customer on the contract did not exist in GP. So I added my routine that creates customers to the code. What I discovered is that the record in the PA00501(PA Customer Master) is not being created. Is there an eConnect node that does this? If not, is there a way with eConnect to create this record? Do I simply need to add code to the taUpdateCreateCustomerRcdPost script?

Categories:
I have the same question (0)
  • Suggested answer
    Isaac Olson Profile Picture
    on at

    Hi Richard,

    You would just have to add a post proc like you mentioned for this. You could either do a check to see if the record exists and if not insert one for the customer using your variables, or you could use a script like this that just updates all customer ids in the company that are missing a PA00501 record in the post proc.

    declare @CUSTNMBR char(30)

    declare @PAcustalias char (30)

    declare @PAcustaliasNEW char (30)

    select @CUSTNMBR = '',

    @PAcustalias = '',

    @PAcustaliasNEW = ''

    declare T_cursor CURSOR for select RM00101.CUSTNMBR, substring(RM00101.CUSTNMBR, 1, 5) as PAcustalias

    from RM00101

    left outer join PA00501 on RM00101.CUSTNMBR = PA00501.CUSTNMBR

    where PA00501.CUSTNMBR is null

    order by RM00101.CUSTNMBR, substring(RM00101.CUSTNMBR, 1, 5)

    set nocount on

    OPEN T_cursor

    FETCH NEXT FROM T_cursor INTO @CUSTNMBR,@PAcustalias

    WHILE (@@FETCH_STATUS <> -1)

    begin

    select @PAcustaliasNEW = @PAcustalias

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'1')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'2')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'3')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'4')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'5')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'6')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'7')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'8')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,4)+'9')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'10')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'11')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'12')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'13')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'14')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'15')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'16')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'17')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'18')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'19')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'20')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'21')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'22')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'23')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'24')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'25')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'26')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'27')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'28')

    end

    if exists (select top 1 * from PA00501 where PAcustalias = @PAcustaliasNEW)

    begin select @PAcustaliasNEW = (substring(@PAcustalias,1,3)+'29')

    end

    insert into PA00501

    select RM00101.CUSTNMBR, @PAcustaliasNEW, 0, 0, 'DEFAULT', '',

    '', 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0, 0, 0,

    0, 0, 0, 0

    from RM00101

    where RM00101.CUSTNMBR = @CUSTNMBR

    FETCH NEXT FROM T_cursor INTO @CUSTNMBR,@PAcustalias

    end

    DEALLOCATE T_cursor

    I hope this helps!

    Isaac Olson

    Microsoft Support

  • Richard Wheeler Profile Picture
    75,852 Moderator on at

    Thanks for this script Isaac, we are currently discussing how to handle this. Out of over 2,500 projects in an external application I found two projects that did not have a matching customer in GP. So I could create a job based on your script or add code to the post script for contracts.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 678 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 407 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 283 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans