ExecAuto MATA020 – Inclusão de Fornecedores(SA2) em MVC

Tempo de leitura: 1 minuto

 

A rotina automática ExecAuto MATA020 tem por objetivo incluir fornecedores(SA2) automaticamente no TOTVS Protheus. Ela é uma das Rotinas Automáticas em ADVPL. 

 

Exemplo em ADVPL da rotina automática ExecAuto MATA020:

#Include "Protheus.ch"
#Include "RwMake.ch"
#Include "TbiConn.ch"

/*{Protheus.doc} User Function ExMAT020
    (Essa função tem por finalidade mostrar a rotina automática com ExecAuto MATA020 em ADVPL)
    @type  Function
    @author Adilio Costa
    @since 27/01/2025

@Inscreva-se no Blog ProtheusAdvpl:
https://www.protheusadvpl.com.br
@Inscreva-se no Canal ProtheusAdvpl:
https://www.youtube.com/protheusadvpl
@Siga-nos no Instagram:
https://www.instagram.com/protheusadvpl
@Conheça os Cursos e Formações do ProtheusAdvpl:
https://cursos-e-formacoes-protheusadvpl.gr-site.com/
|Se esse conteúdo foi útil pra você nos ajude divulgando 
ele e nossas redes sociais!!|
*/


User Function ExMAT020()

	Local nOpc := 3 // ----> Inclusão
	Local oModel := Nil
	Local cCod := "00001"
	Local cLoja := "01"
	Local cNome := "Protheus ADVPL Consultoria e Treinamentos LTDA."
	Local cNReduz := "ProtheusAdvpl"
	Local cEnd := "Rua Protheus, nº 1987"
	Local cBairro := "ADVPL"
	Local cEst := "CE"
	Local cCodMun := "99999"
	Local cMun := "Maracanaú"
	Local cTipo := "J"
	Local cCGC := "878787878787"

	PREPARE ENVIRONMENT EMPRESA "99" FILIAL "0101" MODULO "COM"

	oModel := FWLoadModel('MATA020')

	oModel:SetOperation(nOpc)
	oModel:Activate()

//Cabeçalho
	oModel:SetValue('SA2MASTER','A2_COD' ,cCod)
	oModel:SetValue('SA2MASTER','A2_LOJA' ,cLoja)
	oModel:SetValue('SA2MASTER','A2_NOME' ,cNome)
	oModel:SetValue('SA2MASTER','A2_NREDUZ' ,cNReduz)
	oModel:SetValue('SA2MASTER','A2_END' ,cEnd)
	oModel:SetValue('SA2MASTER','A2_BAIRRO' ,cBairro)
	oModel:SetValue('SA2MASTER','A2_EST' ,cEst)
	oModel:SetValue('SA2MASTER','A2_COD_MUN',cCodMun)
	oModel:SetValue('SA2MASTER','A2_MUN' ,cMun)
	oModel:SetValue('SA2MASTER','A2_TIPO' ,cTipo)
	oModel:SetValue('SA2MASTER','A2_CGC' ,cCGC)

	If(oModel:VldData())
		oModel:CommitData()
	Else
		MsgInfo("Erro ao incluir o fornecedor automaticamente!","Execauto MATA020")
		MostraErro()
	Endif

	oModel:DeActivate()

	oModel:Destroy()

	RESET ENVIRONMENT

Return

 

É isso aí, finalizamos mais um post aqui no Blog ProtheusAdvpl, caso tenha ficado alguma dúvida deixe seu comentário ou nos envie um e-mail para adiliocosta@protheusadvpl.com.br. Até um próximo post. Grande abraço e fica com Deus.

 

Link(s) de referência:

Receba as últimas atualizações do ProtheusAdvpl
Deixe seu melhor email
Nós respeitamos sua privacidade.

34 Comentários


  1. Hi there! Someone in myy Facebook groyp sared thjs site wioth uus soo I came to take a look.
    I’m definittely lovikng the information. I’m bookmarkingg annd wwill bee tweeting
    this too my followers! Fantasstic blog and supefb
    stryle annd design.


  2. signal中文版是一款跨平台的加密消息服务软件。全球各地数百万人每天在使用Signal中文汉化电脑版,signal专注于保护用户隐私的开源即时通讯应用。利用端到端加密技术,Signal确保用户的通讯内容只有通信双方能够解密,即使Signal自身也无法查看。


  3. Hi there! I’m at work surfing around your blog from my new iphone 4!
    Just wanted to say I love reading through your blog and look forward to all your posts!
    Carry on the superb work!


  4. Wow, this post is fastidious, my sister is analyzing
    these things, so I am going to let know her.


  5. Hello there I am so delighted I found your weblog, I really found you by error,
    while I was researching on Digg for something else, Anyhow
    I am here now and would just like to say thank you for a incredible post and a all round exciting blog (I also love the theme/design), I don’t
    have time to browse it all at the minute but I have
    book-marked it and also added your RSS feeds, so when I have time I will be back
    to read a great deal more, Please do keep up the fantastic job.


  6. https://www.tellern.com Telegram应用是开源的,Telegram下载的程序支持可重现的构建。Telegram同时适用于以下环境:Android安卓端,iPhone 和 iPad及MacOS的Apple端,Windows/Mac/Linux桌面版


  7. freebeat™ exercise bikes with thousands of indoor cycling classes, the world’s first 2 in 1 fat tire & city commuter e-bikes &
    more direct to your door.


  8. I’m now not positive the place you are getting your info, but great
    topic. I needs to spend some time studying much more or
    figuring out more. Thanks for magnificent information I used to be on the lookout for this info for my mission.


  9. great post, very informative. I’m wondering why the
    opposiite slecialists of this sector don’t noticce this.

    Yoou must continue your writing. I am sure, you’ve a
    greatt readers’ base already!


  10. Przede wszystkim możecie spodziewać się, że kasyno internetowe pozwoli wam odpowiednio kontrolować wydatki za
    pomocą limitów wpłat.


  11. Explore SakiTime for handcrafted Japanese sake sets,
    Edo Kiriko whisky glasses, and tableware. Each piece
    blends timeless artistry and quality, elevating your moments
    with Japanese craftsmanship.


  12. Thanks for a marvelous posting! I certainly enjoyed reading it, you happen to
    be a great author.I will ensure that I bookmark your blog and may come back sometime soon. I want
    to encourage you to definitely continue your great posts, have a nice day!


  13. Facing financial hardship? battling to keep up with rent payments can be a terrifying experience.

    Thankfully, Riverside offers numerous resources available to help residents in need.
    A multitude of organizations and programs stand ready to assist,
    ensuring no one faces eviction alone.


  14. You are so cool! I don’t believe I have read a single thing like this before.
    So nice to discover somebody with a few genuine thoughts on this topic.
    Seriously.. thank you for starting this up. This website is something that’s
    needed on the web, someone with a bit of originality!


  15. Superb blog you have here but I was wanting to know if you knew of any message boards that cover the same topics talked about here?
    I’d really love to be a part of online community where I can get responses from other knowledgeable people
    that share the same interest. If you have any suggestions, please let me know.

    Thank you!


  16. Its such as you read my thoughts! You appear to understand so
    much approximately this, such as you wrote the book in it or something.
    I feel that you just can do with a few percent to power the message home
    a little bit, however instead of that, that is magnificent
    blog. A great read. I will definitely be back.


  17. Oh my goodness! Impressive article dude! Thank you, However I am experiencing troubles with your RSS.
    I don’t understand why I cannot subscribe to it.
    Is there anybody else getting identical RSS issues?
    Anyone who knows the answer will you kindly respond?

    Thanks!!


  18. I was curious if you ever considered changing the page layout of your website?

    Its very well written; I love what youve got to say.

    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or two pictures.
    Maybe you could space it out better?


  19. Hello! I’m at work surfing around your blog from my new iphone!
    Just wanted to say I love reading through your blog and look
    forward to all your posts! Carry on the superb work!


  20. Very good info. Lucky me I discovered your website by chance (stumbleupon).
    I’ve book-marked it for later!


  21. hello there and thank you for your info – I have certainly picked up something new
    from right here. I did however expertise several technical
    points using this site, as I experienced to reload the
    site many times previous to I could get it to load properly.
    I had been wondering if your web host is OK?
    Not that I’m complaining, but slow loading instances times will often affect your placement
    in google and can damage your high-quality score if
    ads and marketing with Adwords. Well I am adding
    this RSS to my e-mail and can look out for a lot more of your
    respective intriguing content. Ensure that you update this
    again very soon.


  22. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.

    You obviously know what youre talking about, why waste your intelligence on just posting videos to your site when you
    could be giving us something informative to read?


  23. Web 版Skype 是享受您在傳統型應用程式中熟悉的Skype 功能最簡單的方法,而不需要下載。 您可以登入Web 版Skype 然後立即開始聊天。https://www.skypeie.com


  24. For latest news you have to pay a quick visit internet and on world-wide-web I found
    this website as a finest web page for hottest updates.


  25. Hi would you mind letting me know which webhost you’re working with?
    I’ve loaded your blog in 3 completely different web browsers and I must say this blog loads
    a lot quicker then most. Can you suggest a good hosting provider
    at a fair price? Many thanks, I appreciate it!

Comentários encerrados.